<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>登录</title>
    <script src="../javascripts/jquery.min.js"></script>
</head>
<body>
    账号：<input type="text" id="account">
    密码:<input type="text" id="pasworld">
    <input type="button" value="登录" id="submit">
    <script>
        $("#submit").on('click',function(){
            $.ajax({
            url:'/users/login',
            type:'post',
            data:{
                account:$("#account").val(),
                pasworld:$("#pasworld").val()
            },
            success:function(data){
                alert(data.mess)
               if(data.mess.indexOf('成功')){
                localStorage.setItem('token',data.data)
               }
            }
        })
        })
    </script>
</body>
</html>